<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>自定义插件</title>
    <script src="../js/vue.js"></script>
    <script src="./riyu.js"></script>
</head>
<body>
    <div id="root">
        <h2 v-upper-text="name"></h2>
        <h2 v-lower-text="name"></h2>
        <h2>{{$random(2,8)}}</h2>
    </div>

    <script>
        /* 
            插件的定义: 是一个包含install方法的对象
        */
        Vue.config.productionTip = false; //关闭开发者提示
        // Vue.prototype.$now = new Date().toTimeString()

        //Vue会帮我们去调用riyu这个插件里的install方法
        Vue.use(riyu)
        console.log(Vue.projectName);
        console.log(Vue.myVersion);
        Vue.showInfo()

        const vm = new Vue({
            el: '#root',
            data: {
                name: 'mengZiLaoShiRiYuXueXi'
            }
        })
    </script>
</body>
</html>